﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<dynamic>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">
<%= TempData["Message"]%>
    <div id="cactionbutton">
        <button type="button" id="btnRefesh" title="Làm mới" class="button refresh">Làm mới</button> 
        <button type="button" id="btnDelete" title="Xóa" class="button delete">Xóa</button>
        <button type="button" id="btnAddNew" title="Tạo mới" class="button addnew">Tạo mới</button> 
    </div>
   
    <div class="clist">
        <table id="list" class="scroll">
        </table>
        <div id="pager" class="scroll" style="text-align: center;">
        </div>
    </div>
    
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="PageTitle" runat="server">
    Quản lý bản tin
</asp:Content>
<asp:Content ID="Content8" ContentPlaceHolderID="HeadContent" runat="server">
    <script type="text/javascript">
        function sendMail(id) {
            
            JS_LIB.popup('/Administration/NewsLetter/SendMail/'+id, 'Gửi bản tin', 700);
        }
        jQuery(document).ready(function () {
            //Add New
            $("#btnAddNew").click(function () {
                window.location = "/Administration/NewsLetter/Create";
            });
            // refresh button
            $("#btnRefesh").click(function () {
                window.location = "/Administration/NewsLetter";
            });
           
            // delete button           
            $("#btnDelete").click(function () {
                JS_LIB.deletes('#list', 'ID', '/Administration/NewsLetter/DeleteList');
            });
        });
    </script>
    <%  
        TSV.Library.Controls.GridViewControls grid = new TSV.Library.Controls.GridViewControls();
        grid.Width = 1200;
                
        string[] colNames = { "Stt", "ID", "Tiêu đề","Ngày tạo","Đã gửi", "Chức năng" };
        string[] colModels = {  "{ name: 'No', index: 'No', align: 'center', width: 20}",
                                "{ name: 'ID', index: 'ID', align: 'center', width: 50,hidden: true}",
                                "{ name: 'Title', index: 'Title', align: 'left', width: 400,sortable: true}",
                                "{ name: 'CreateDate', index: 'CreateDate', align: 'center', width: 100,sortable: true}",
                                "{ name: 'IsSent', index: 'IsSent', align: 'center', width: 100,sortable: true}",
                                "{ name: 'Action', index: 'Action', editable: false, width: 50, align: 'center', sortable: false}"
                            };

        Response.Write(grid.ShowGrid("/Administration/NewsLetter/GetListJQGrid/", colNames, colModels));
    %>
    
</asp:Content>

<asp:Content ID="Content4" ContentPlaceHolderID="ModuleName" runat="server">
Quản lý bản tin
</asp:Content>

<asp:Content ID="Content5" ContentPlaceHolderID="FunctionTitle" runat="server">
Quản lý bản tin
</asp:Content>

<asp:Content ID="Content6" ContentPlaceHolderID="LoginRoles" runat="server">
</asp:Content>
